﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Newtonsoft.Json.Linq;
using System.IO;
using DailyPhoto.Entities;
using Quartz;
using Quartz.Impl;
using System.Threading;
using System.ServiceProcess;

namespace DailyPhoto
{
    class Program
    {
        static void Main(string[] args)
        {

            if (Array.Exists(args, str => str == "/console"))
            {
                StartConsole();
                return;
            }

            ServiceBase[] ServicesToRun;
            
            ServicesToRun = new ServiceBase[] 
            { 
                new DailyPhotoService() 
            };

            ServiceBase.Run(ServicesToRun);
        }

        public static void StartConsole()
        {
            var srv = new DailyPhotoService(true);
            Thread.Sleep(Timeout.Infinite);
        }
    }
}
